#pragma once

#include "common.h"

#include <QtCore/QObject>
#include <QtCore/QPoint>

class UserTool : public QObject
{
    Q_OBJECT

public:
    virtual bool eventFilter(QObject *object, QEvent *event) = 0;

    void installTool(class Viewer *viewer);
    void uninstallTool(class Viewer *viewer);
};

class ZoomTool : public UserTool
{
    Q_OBJECT
public:
    ZoomTool(double factor);
    virtual bool eventFilter(QObject *object, QEvent *event);
private:
    double zoomFactor;
};

class DragTool : public UserTool
{
    Q_OBJECT
public:
    virtual bool eventFilter(QObject *object, QEvent *event);
private:
    QPoint point;
};


class SelectTool : public UserTool
{
    Q_OBJECT
public:
    virtual bool eventFilter(QObject *object, QEvent *event);
};

class SearchTool : public UserTool
{
    Q_OBJECT
public:
    SearchTool ();
    virtual bool eventFilter ( QObject *object, QEvent *event );
};
